package com.cjj.controller;

import com.cjj.service.TMentalityService;
import com.cjj.vo.MentalityTestVo;
import com.cjj.vo.TBodyTypeVo;
import com.cjj.vo.TMentalityVo;
import com.github.pagehelper.PageInfo;
import com.guigu.pojo.TMember;
import com.guigu.pojo.TMentalityResult;
import com.guigu.pojo.TMentalityTest;
import com.guigu.viwe.PageVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/TMentality")
public class TMentalityController {
    @Resource
    private TMentalityService tMentalityService;

    //    模糊查询心里测试
    @RequestMapping("/queryMentality")
    public PageInfo<TMentalityVo> queryMentality(@RequestBody PageVo<TMentalityVo> pageVo) {
        PageInfo<TMentalityVo> tBodyTypeVoPageInfo = this.tMentalityService.queryMentality(pageVo);
        return tBodyTypeVoPageInfo;
    }

    //    查询是否以经体检过
    @RequestMapping("/queryTMentalityIsNull")
    public TMentalityVo queryTMentalityIsNull(String fileName){
        return this.tMentalityService.queryTMentalityIsNull(fileName);
    }
    //查询所有种类
    @RequestMapping("/queryOptions")
    public List<MentalityTestVo> queryOptions(){
        return this.tMentalityService.queryOptions();
    }

//    添加心理评估
    @RequestMapping("/addMentality")
    public int addMentality(@RequestBody Map map){
        return this.tMentalityService.addMentality(map);
    }


    // 查询需要修改的心理评估
    @RequestMapping("/showUpdateRow")
    public TMember showUpdateRow(String memberId){
        return this.tMentalityService.showUpdateRow(memberId);
    }

    //修改心理评估
    @RequestMapping("/updateMentality")
    public int updateMentality(@RequestBody Map map){

        return this.tMentalityService.updateMentality(map);
    }
    //添加人群分类
    @RequestMapping("/classification")
    public int classification(String TmemberId){
        return this.tMentalityService.classification(TmemberId);
    }



}
